/**
 * @Description:
 * @Author BPF
 * @create 2021/10/6 14:23
 */
import { Vite, Type } from '@bianpengfei/utils'
const { requireAllModule } = Vite
export default {
  install: app => {
    /**
     * 注册所有插件
     */
    requireAllModule({
      requireContext: import.meta.globEager('./modules/**/*.js'),
      exclude: ['./modules/index.js']
    }).forEach(v => {
      if (Type.isFunction(v?.default?.install)) {
        app.use(v?.default)
      }
    })
  }
}
